package com.java.comprehensive.design.building_modelling.factory_pattern.coffee.simple;

class SimpleCoffeeFactory {

    public Coffee createCoffee(String coffeeType) {
        Coffee coffee = null;
        if ("美式".equals(coffeeType)) {
            coffee = new AmericaCoffee();
        } else if ("拿铁".equals(coffeeType)) {
            coffee = new LatteCoffee();
        } else {
            throw new RuntimeException();
        }
        return coffee;
    }


}
